<html>

<head>
<title>Swing Single Frame Application (JSR 296) Wizard</title>
<link href="../../../book.css" rel="stylesheet" type="text/css" />
</head>

<body>

<h1>Swing Single Frame Application (JSR 296) Wizard</h1>

<table border="0" cellpadding="0" cellspacing="0" width="750">
  <tr>
    <td>
        <img src="images/wizard_swing_singleframeapplication0.gif" align="left" hspace="10">Subclasses of the Swing <b>SingleFrameApplication</b> class can be
              created using the <b>Swing Single Frame Application (JSR 296)</b>&nbsp; wizard. The wizard can be
              selected from the drop down wizard menu or from the
              Eclipse <b>New</b> wizard.
              <p>To use the wizard, select the project source folder and package
              to contain the class. Then enter the class name and hit the <b>Finish</b>
              button.<p>The <b>org.jdesktop.application.SingleFrameApplication</b> class is the default
              superclass. You can select an alternative superclass by entering
              its name into the <b>Superclass</b> field or by choosing it via
              the bottom <b>Browse</b> button.</td>
  </tr>
  <tr>
    <td>
      <p><br>
		<img src="images/wizard_swing_singleframeapplication1.gif">&nbsp; 
		<img src="images/wizard_swing_singleframeapplication2.gif" width="360" height="358"></p>
    </td>
  </tr>
  <tr>
    <td>
      <p><br>
		The wizard generates the following code including a <b>main()</b> method.</p>
      <font SIZE="2" COLOR="#7f0055"><b>
		<blockquote>
			<p><font face="Courier">import</font></b></font><font SIZE="2"><font face="Courier"> 
			java.awt.Dimension;</font></dd>
			</font><font SIZE="2" COLOR="#7f0055"><b><font face="Courier"><br>
			import</font></b></font><font SIZE="2"><font face="Courier"> 
			javax.swing.ActionMap;</font></dd>
			</font><br>
			<font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font SIZE="2"><font face="Courier"> 
			javax.swing.JPanel;</font></dd>
			</font><br>
			<font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font SIZE="2"><font face="Courier"> 
			org.jdesktop.application.ApplicationContext;</font></dd>
			</font><br>
			<font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> 
			org.jdesktop.application.SingleFrameApplication;<br>
			<br>
			</font><font SIZE="2" COLOR="#7f0055"><b>
			<font face="Courier">public</font></b></font><font face="Courier"><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>class</b></font><font SIZE="2"> 
			SwingSingleFrameApplication </font><font SIZE="2" COLOR="#7f0055">
			<b>extends</b></font></font><font face="Courier" SIZE="2"> 
			SingleFrameApplication {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier"><font SIZE="2" COLOR="#7f0055"><b>private</b></font><font SIZE="2"> JPanel 
			</font><font SIZE="2" COLOR="#0000c0">topPanel</font></font><font face="Courier" SIZE="2">;<br>
			</font><font SIZE="2" COLOR="#646464" face="Courier"><br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; </b>
			</font><font SIZE="2" COLOR="#646464" face="Courier">@Override</dd>
				</font><br>
			<font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; </b></font>
			<font face="Courier"><font SIZE="2" COLOR="#7f0055"><b>protected</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>void</b></font></font><font face="Courier" SIZE="2"> 
				startup() {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp; 
			</b></font><font face="Courier"><font SIZE="2" COLOR="#0000c0">topPanel</font><font SIZE="2"> 
					= </font><font SIZE="2" COLOR="#7f0055"><b>new</b></font></font><font face="Courier" SIZE="2"> 
					JPanel();<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp; 
			</b></font><font face="Courier"><font SIZE="2" COLOR="#0000c0">topPanel</font><font SIZE="2">.setPreferredSize(</font><font SIZE="2" COLOR="#7f0055"><b>new</b></font></font><font face="Courier" SIZE="2"> 
					Dimension(500, 300));<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </b>
			</font><font face="Courier" SIZE="2">show(</font><font SIZE="2" COLOR="#0000c0" face="Courier">topPanel</font><font face="Courier" SIZE="2">);<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font face="Courier" SIZE="2">}<br>
			<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; </b>
			</font><font face="Courier"><font SIZE="2" COLOR="#7f0055"><b>public</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>static</b></font><font SIZE="2">
			</font><font SIZE="2" COLOR="#7f0055"><b>void</b></font></font><font face="Courier" SIZE="2"> 
				main(String[] args) {<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </b>
			</font><font face="Courier" SIZE="2"><i>launch</i>(SwingSingleFrameApplication.</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>class</b></font><font face="Courier" SIZE="2">, 
					args);<br>
			</font><font SIZE="2" COLOR="#7f0055" face="Courier"><b>&nbsp;&nbsp;&nbsp;
			</b></font><font SIZE="2"><font face="Courier">}<br>
			}</font></p>
		</blockquote>
		</font>
      <p>When editing Swing <b>SingleFrameApplications</b>, all of the standard Swing layouts,
      containers, widgets and menus are available. Custom or third party
      controls may be added via the <b>
		<a href="../../../com.instantiations.designer.doc.user/html/userinterface/palette.html">Choose 
		Component</a></b> command. You may also
      preview your frame using different look and feels using the drop down look
      and feel list in the toolbar.</p>
    </td>
  </tr>
</table>
</body>
</html>
